package com.hzhjhh.view.cashierView.enums;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 商品信息表映射枚举
 * @TableName sm_merchandise
 */
@Getter
@AllArgsConstructor
public enum MerchandiseShowEnum {
	
	CODE("code", "商品编码"),
	NAME("name", "商品名称"),
	SPEC("spec", "规格"),
	UNITS("units", "单位"),
	NUM("number", "数量"),
	SALE_PRICE("salePrice", "售价"),
	DISCOUNT("discount", "折扣"),
	AMT("amt", "金额"),
	
	MERCHANDISE_PURCHASE_PRICE("purchasePrice", "进货价"),
//	merchandiseCheckTerm("merchandiseCheckTerm", "保质期"),
	MERCHANDISE_REMARK("merchandiseRemark", "备注"),
	;

	/**
	 * 列名称
	 */
	private final String cloumnName;
	/**
	 * 列展示时对应的名称
	 */
	private final String cloumnShowName;

	
	public static Map<String, String> codeMap() {
		return Arrays.asList(MerchandiseShowEnum.values())
		.stream()
		.collect(Collectors.toMap(MerchandiseShowEnum::getCloumnName, MerchandiseShowEnum::getCloumnShowName, (v1, v2) -> v1));
	}
	
	public static Map<String, String> descMap() {
		return Arrays.asList(MerchandiseShowEnum.values())
				.stream()
				.collect(Collectors.toMap(MerchandiseShowEnum::getCloumnShowName, MerchandiseShowEnum::getCloumnName, (v1, v2) -> v1));
	}
	
	public static void main(String[] args) {
		for (MerchandiseShowEnum showEnum : MerchandiseShowEnum.values()) {
			System.out.println(showEnum.cloumnShowName);
		}
	}
}